An O(nm) time algorithm for finding the min length directed cycle in a graph
نویسندگان
چکیده
In this paper, we introduce an O(nm) time algorithm to determine the minimum length directed cycle in a directed network with n nodes and m arcs and with no negative length directed cycles. This result improves upon the previous best time bound of O(nm + n log log n). Our algorithm first determines the cycle with minimum mean length λ∗ in O(nm) time. Subsequently, it chooses node potentials so that all reduced costs are λ∗ or greater. It then solves the all pairs shortest path problem, but restricts attention to paths of length at most nλ∗. We speed up the shortest path calculations to O(m) per source node, leading to an O(nm) running time in total. We also carry out computational experiments comparing the performance of the proposed methods and other state-of-the-art methods. Experiments confirmed that it is advantageous to solve the minimum mean cycle problem prior to solving shortest path problems. Analysis of our experiments suggest that the running time to solve the minimum length directed cycle problem was much faster than O(n) on average.
منابع مشابه
Computing Cycle Covers without Short Cycles
A cycle cover of a graph is a spanning subgraph where each node is part of exactly one simple cycle. A k-cycle cover is a cycle cover where each cycle has length at least k. We call the decision problems whether a directed or undirected graph has a k-cycle cover k-DCC and k-UCC. Given a graph with edge weights one and two, Min-k-DCC and Min-k-UCC are the minimization problems of finding a k-cyc...
متن کاملFaster Algorithms for Online Topological Ordering
We present two algorithms for maintaining the topological order of a directed acyclic graph with n vertices, under an online edge insertion sequence of m edges. Efficient algorithms for online topological ordering have many applications, including online cycle detection, which is to discover the first edge that introduces a cycle under an arbitrary sequence of edge insertions in a directed grap...
متن کاملSIMULATED ANNEALING ALGORITHM FOR SELECTING SUBOPTIMAL CYCLE BASIS OF A GRAPH
The cycle basis of a graph arises in a wide range of engineering problems and has a variety of applications. Minimal and optimal cycle bases reduce the time and memory required for most of such applications. One of the important applications of cycle basis in civil engineering is its use in the force method to frame analysis to generate sparse flexibility matrices, which is needed for optimal a...
متن کاملA note on finding minimum mean cycle
In a directed graph with edge weights, the mean weight of a directed cycle is the weight of its edges divided by their number. The minimum cycle mean of the graph is the minimum mean weight of a cycle. Karp gave a characterization of minimum cycle mean and an O(nm) algorithm to compute it, where n is the number of vertices and m is the number of edges. However, an algorithm he suggested for ide...
متن کاملDeciding Graph non-Hamiltonicity via a Closure Algorithm
We present a matching and LP based heuristic algorithm that decides graph non-Hamiltonicity. Each of the n! Hamilton cycles in a complete directed graph on n + 1 vertices corresponds with each of the n! n-permutation matrices P, such that pu,i = 1 if and only if the ith arc in a cycle enters vertex u, starting and ending at vertex n + 1. A graph instance (G) is initially coded as exclusion set ...
متن کامل